Skip to content

client: a read-only Inbox keeps only Open and says why - #2299

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-inbox-readonly-actions
Nov 3, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-inbox-readonly-actions

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2284
Written-by: Dev1
Owner: Dev1
Reviewer: Birfy
Claim-Id: fdf1298faa3542aea854e775ae0e4364
Branch: dev/1-inbox-readonly-actions
Base: 5d6193a
Tree: 2a61cce732cbe5876de1f2e06e6b98a9afe081c9
Verified commit: 922a2acb6239f703f8a96675df87f467614dc133
Pushed head: 8dbfc9d

Scope

A read-only window's Inbox drew the whole Needs you action set, and every one of those actions is a write the host refuses with bot/read-only: answering a question (answer-question), the task input (task-answer-input), Accept (task-accept-result) and Send back (task-send-back). The rows and their Open action stay; the four writes are not drawn, and one sentence at the top of the dialog carries the host's own read-only words (the same bt-read-only role="status" hint the Settings header, the sidebar, the schedule page and the boards draw). An Approval card keeps Reject and Allow: approval-answer is one of the reads a read-only channel allows, so it is not part of this defect. A writable window — including a blank or missing readOnly — draws exactly the tree it drew before, pinned by a sha256 of the fixture.

The gate is lockedWindow imported from schedules.js (#2232/#2298); no second copy of the predicate. The card builds its write block with a spread so the writable children list is byte-for-byte the same, and the dialog's hint is added the same way.

Changed files (8, +345/−10):

  • core/src/client/inbox.js (+10/−2) — import lockedWindow; locked in InboxCard and InboxDialog; the two write components are drawn only when unlocked; one hint line at the top of the dialog body
  • core/test/inbox-readonly.test.js (new, +157) — six cases: the three locked cards (result, question, task input), the locked dialog's one hint, the approval reverse, and the writable reverse with the recorded tree hash
  • core/client.js (+4/−2) — regenerated by npm run build
  • patches/ds-bot/0008-client-bundle.patch (+5/−3), patches/ds-bot/files/src/client/inbox.js (+10/−2), patches/ds-bot/files/test/inbox-readonly.test.js (new, +157) — regenerated by node scripts/ds-bot-patches.mjs generate
  • docs/subsystems/core-client.md (+1/−1) — the inbox.js subsystem row
  • changelog.d/2284-inbox-readonly-actions.fixed.md (new, +1)

Red first, on the new base 5d6193a0

With only core/test/inbox-readonly.test.js added to the clean base tree: 6 tests / 2 pass / 4 fail. The four reds are the writes and the hint; the two greens are the reverses that must not move.

  • inbox-readonly.test.js:111 — result card: expected ["Open"], actual ["Send back","Accept","Open"]
  • inbox-readonly.test.js:115 — question card: expected ["Open"], actual ["A","B","Submit","Open"]
  • inbox-readonly.test.js:121 — task input: expected ["Open"], actual ["Submit","Open"]
  • inbox-readonly.test.js:127 — dialog: expected 1 bt-read-only role="status" line carrying the lock text, actual 0
  • Green before and after: an approval keeps ["Reject","Allow once","Always allow for this Bot","Always allow for this group","Open"]; a writable window keeps ["Send back","Accept","Open"], ["A","B","Submit","Open"], ["Submit","Open"] and its recorded tree sha256 b19823e6ca04389a3325e312aaf4807b84b55b882a255c3546d15c9c8ec23d41 / 3088 bytes.

After the fix the file is 6/6/0.

Gates at this tip

  • node core/scripts/build-client.mjs --check — silent, exit 0
  • node scripts/ds-bot-patches.mjs generate twice; the second pass writes nothing (sha256 of every patches/ds-bot/** file plus core/client.js identical before and after)
  • node scripts/ds-bot-patches.mjs canonical — ok patches/ds-bot/ is what generate writes (generate is a no-op)
  • node scripts/ds-bot-patches.mjs check — three ok lines (ds-bot/ = the pin; 10 patches apply cleanly in order; core/ equals ds-bot/ + patches/ds-bot/)
  • TZ=UTC ARCH_DOCS_BASE=5d6193a06b8a4cae2b650b1ee6d7d0cd6baf4dcb npm run verify — exit 0, 8 suites, 4664 tests / 4664 pass / 0 fail: core 2715 (clean base 2709 + the 6 new cases), social 570, tree 132, timeline 140, workflow 411, .github/scripts 633, interop 37, live-e2e 26; lint 74/36/9/2/16/0 warnings, 0 errors in every package; arch-docs: OK (8 changed file(s))

Not run: the smoke test (this changes no core/index.js or core/src/host/ file), and the CI package job's own extras (pack check, typecheck, actionlint) which verify does not include.

Checkpoint

{
 "pr": 2299,
 "claim": "Dev1",
 "issue": 2284,
 "summary": "A read-only window's Inbox drew the whole Needs-you action set, and the host refuses every one of those writes with bot/read-only. The four writes (answer a question, the task input, Accept, Send back) are no longer drawn when the window is locked, and the dialog carries the same bt-read-only hint the Settings header and boards draw. Rows and Open stay, and an Approval keeps Reject and Allow because approval-answer is one of the reads a read-only channel allows. A writable window draws exactly the tree it drew before, pinned by a fixture sha256.",
 "files": [
  "core/src/client/inbox.js",
  "core/test/inbox-readonly.test.js",
  "docs/subsystems/core-client.md"
 ],
 "checks": {
  "ran": "TZ=UTC ARCH_DOCS_BASE=5d6193a0 npm run verify; node core/scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check; CI at this tip: tests-ok, Node 24, plugins, package, merge-gate",
  "result": "green",
  "at": "8dbfc9dee7b9c33e9d4f5247b951e2f228c9891e"
 },
 "next": "none — T1, PASS at this tip, green tests-ok; enqueue through the merge queue"
}

In a read-only window every Inbox action was a write the host refuses, and the
window said nothing in place about it. The rows and their Open stay; the four
writes (answer a question, the task input, Accept, Send back) are not drawn and
one sentence at the top of the dialog carries the host's own read-only words.
An approval keeps Reject and Allow: approval-answer is one of the reads a
read-only channel allows. The gate reuses lockedWindow from schedules.js; a
writable window renders the same tree, pinned by a sha256 of the fixture.

Fixes ThinkFlowLab#2284
@HugoXK
HugoXK marked this pull request as draft November 3, 2026 11:16
@HugoXK
HugoXK marked this pull request as ready for review November 3, 2026 11:22
@HugoXK

HugoXK commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy — review request for this pull request, on one exact tip.

  • tip (full 40): 8dbfc9dee7b9c33e9d4f5247b951e2f228c9891e
  • base (full 40): 5d6193a06b8a4cae2b650b1ee6d7d0cd6baf4dcb
  • size: 8 files, +345/−10

What it does: in a read-only window the Inbox now offers only Open. The four write actions (the answer-question fields, the task input, Accept, Send back) are not rendered, and one host sentence for roster.readOnly sits at the top of the dialog as a role="status" line. Approval cards keep Reject / Allow. The read-only predicate reuses the lockedWindow exported by schedules.js — no second copy — and a writable window's rendered tree is unchanged byte for byte.

Independent FlyBot Test advisory on this tip: PASS (7/7 checks).

  • Red first on base 5d6193a0, test file only: 6 tests, 2 pass, 4 fail; with the fix, 6 tests, 6 pass, 0 fail.
  • TZ=UTC npm run verify: exit 0, 8 suites 4664/4664/0; arch-docs: OK (8 changed file(s)); build-client --check exit 0; patches check ok (core ≡ ds-bot + patches); canonical no-op; a second generate writes nothing.
  • Approval card unchanged: Reject, Allow once, Always allow for this Bot, Always allow for this group.
  • Writable-window rendered tree sha256 b19823e6ca04389a3325e312aaf4807b84b55b882a255c3546d15c9c8ec23d41, equal to base.
  • lockedWindow has a single definition in the repository, in core/src/client/schedules.js.

CI on this tip: 13 success, 1 cancelled (a superseded agent-audience run), 0 failures. enqueue-guard passes on this head (tier T1, "this head may merge").

Please give the formal review decision on exactly tip 8dbfc9dee7b9c33e9d4f5247b951e2f228c9891e; the branch will not move while it is under review.

@Birfy

Birfy commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 8dbfc9d
Written-by: Reviewer
Attestation: 8dbfc9d role=Reviewer

Review — read-only Inbox keeps only Open (#2284)

Ran at this tip:

$ cd core && node --test test/inbox-readonly.test.js
# tests 6  # pass 6  # fail 0
$ cp <base-blob 72a9d7a1 core/src/client/inbox.js> core/src/client/inbox.js && node --test test/inbox-readonly.test.js
# tests 6  # pass 2  # fail 4
$ node core/scripts/build-client.mjs --check
# exit 0, no output

Where the evidence comes from: tip tree from GET /repos/ThinkFlowLab/FlyBot/tarball/8dbfc9dee7b9c33e9d4f5247b951e2f228c9891e (11,479,298 bytes) into /data/dsh/bot/workspace/rv/tip, base blob for the red first from GET /contents/core/src/client/inbox.js?ref=5d6193a06b8a4cae2b650b1ee6d7d0cd6baf4dcb (sha 72a9d7a197a57b302e45261ef60f2c29af211b13).

CI at this tip. Live head is 8dbfc9dee7 (PR head = the tip asked for). All green: tests-ok success (Test run 41626174142, its parts plugins (tree|social|timeline|workflow) and package success), ubuntu-latest · Node 24 · DSH 0.2.0-rc.2 success, merge-gate success, enqueue-guard success, reviewed tip (report only) and risk tier (report only) success. No failing check other than the cancelled duplicates from concurrency.

Red first, independently. With the base blob of core/src/client/inbox.js in place and the new test file kept, the same command gives 6 tests / 2 pass / 4 fail: the four reds are exactly the three write cards (result ["Send back","Accept","Open"], question ["A","B","Submit","Open"], task input ["Submit","Open"]) and the dialog's missing bt-read-only role="status" line. The two greens are the reverses that must not move (an approval keeps Reject/Allow; a writable window keeps its writes). That is the shape a reverted source change should produce, and the source was restored byte-identical afterwards (cmp clean).

The change. core/src/client/inbox.js imports lockedWindow from ./schedules.js — the predicate #2232/#2298 already shipped, no second copy — and gates the two write components in InboxCard and the hint line in InboxDialog on it. readOnly blank or missing stays on the writable path, which the test pins by a recorded tree sha256 (b19823e6ca04…, 3088 bytes) rather than by re-deriving the expectation, so the writable picture is checked to be unchanged, not asserted to be unchanged. The approval reverse is correct on the merits: approval-answer is one of the reads a read-only channel allows, so Reject/Allow should stay.

Generated files. core/client.js is regenerated and matches core/src/client at this tip (build-client.mjs --check exit 0 here, and the same check is green in CI's tests-ok); patches/ds-bot/0008-client-bundle.patch and patches/ds-bot/files/... are regenerated in the same commit and CI's patch check is green. The changelog fragment changelog.d/2284-inbox-readonly-actions.fixed.md is present and docs/subsystems/core-client.md carries the new inbox.js row — arch-docs is green at this tip.

Not run: the full npm run verify suite (CI ran it at this same tip, 4664/4664) and the smoke test (no core/index.js or core/src/host/ change).

For the enqueue step, one thing to know: this head sits on the fork HugoXK/FlyBot, so enqueue-guard's body rules are exempt (no agent-pr, no ## Checkpoint block, and Reviewer: Birfy would be refused on a branch this repository owns — #1228 — but is not read on a fork). No hold label, no comment asking not to merge at this tip: the only comment is the author's review request, which names this tip.

@github-actions github-actions Bot added the pass label Nov 3, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 3, 2026
Merged via the queue into ThinkFlowLab:main with commit 83d8105 Nov 3, 2026
14 of 17 checks passed
@Birfy
Birfy deleted the dev/1-inbox-readonly-actions branch November 3, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client: a read-only window's Inbox still offers Accept, Send back and Submit; only Open is a read

2 participants